import request from "@/utils/request";

// 分页获取评论
export function getComment(page = 1, limit = 10) {
  return request({
    url: "/api/comment",
    method: "GET",
    params: {
      page,
      limit,
      blogid: "all",
    },
  });
}

// 删除评论
export function delComment(id) {
  return request.delete(`/api/comment/${id}`);
}
// 分页获取文章评论
export function getBolgsComment(page = 1, limit = 10) {
  return request({
    url: "/api/comment/getBolgsComment",
    method: "GET",
    params: {
      page,
      limit,
    },
  });
}
// 删除文章评论
export function delBlogsComment(data) {
  return request({
    url: "/api/comment/delBlogsComment",
    method: "post",
    data,
  });
}
// 获取所有该条评论的回复
export function getCommentReply(id) {
  return request({
    url: "/api/newMessage/getOtherCommentList",
    method: "GET",
    params: {
      ceId: id,
    },
  });
}
// 删除一条评论的回复
export function delCommentReply(articleId, ceId, id) {
  return request({
    url: "/api/newMessage/delCommentReply",
    method: "GET",
    params: {
      articleId,
      ceId,
      id,
    },
  });
}
